package cn.mingfancloud.test.面向对象综合训练;


import java.util.Random;
public class nodeode {



    public static void main(String[] args) {
        System.out.println(generateVerificationCode());
    }

    public static String generateVerificationCode() {
        StringBuilder code = new StringBuilder();
        Random random = new Random();

        // 生成前四位
        for (int i = 0; i < 4; i++) {
            if (random.nextBoolean()) {
                code.append((char) ('A' + random.nextInt(26)));
            } else {
                code.append((char) ('a' + random.nextInt(26)));
            }
        }

        // 生成最后一位数字
        code.append(random.nextInt(10));

        return code.toString();
    }
}


